﻿using School;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace TestSchool
{
    [TestClass()]
    public class StudentTest
    {
        [TestMethod()]
        public void StudentConstructorTestCorrect()
        {
            string name = "Ivo";
            int facultyNumber = 44268;
            Student target = new Student(name, facultyNumber);

            Assert.AreEqual(name, target.Name);
            Assert.AreEqual(facultyNumber, target.FacultyNumber);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void StudentConstructorTestEmptyName()
        {
            string name = "";
            int facultyNumber = 44268;
            Student target = new Student(name, facultyNumber);

            Assert.AreEqual(name, target.Name);
            Assert.AreEqual(facultyNumber, target.FacultyNumber);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void StudentConstructorTestLessFacultyNumber()
        {
            string name = "Ivo";
            int facultyNumber = 4426;
            Student target = new Student(name, facultyNumber);

            Assert.AreEqual(name, target.Name);
            Assert.AreEqual(facultyNumber, target.FacultyNumber);
        }

        [TestMethod()]
        [ExpectedException(typeof(ArgumentException))]
        public void StudentConstructorTestGreaterFacultyNumber()
        {
            string name = "Ivo";
            int facultyNumber = 442688;
            Student target = new Student(name, facultyNumber);

            Assert.AreEqual(name, target.Name);
            Assert.AreEqual(facultyNumber, target.FacultyNumber);
        }
    }
}
